﻿@RenderPage(view)
@functions{
    private string action;
    private string id;
    private string view;
    protected override void InitializePage()
    {
    // Get first verb from Url and use as action
    var action = UrlData[0].ToLower(); 
    // Get second verb and use it as id.
    var id = UrlData[1];
    // Example:
    // mysite.com/projects/edit/0
    // UrlData[0] returns "edit"
    // UrlData[1] returns "0"
     
    // Now act on the action verb:   
    switch(action) {      
        case "ccml":
            view="/Reports/_CCMasterList.cshtml";
            break;
        case "vlist":
            view="/Reports/_ValidationList.cshtml";
            break;
        case "pal":
            view ="/Reports/_PendingAppList.cshtml";
            break;
        case "aip":
            view ="/Reports/_AppInProgress.cshtml";
            break;
        case "delete":
            if (!IsPost)
            {        
                var GetDataModelFromDb = "MockData for record # " + id;
                Page.Model = GetDataModelFromDb;               
                view = "/Customer/_Delete.cshtml";       
            }
            else
            {
                //<strong>Handle delete</strong>
            }           
            break;
       
        default:
            view = "/Reports/_Search.cshtml";       
            break;
        }
    }
}
